import { Request } from "./request";
//首页轮播及头部轮播
module.exports.Banner = () => Request({
  url: "/banner/list",
  method: "get"
})
//通告
module.exports.notice = () => Request({
  url: "/notice/list",
  method: "post"
})
//九宫格
module.exports.nine = () => Request({
  url: "/shop/goods/category/all",
  method: "get"
})
// 分类右边
module.exports.category = (id) => Request({
  url: `/shop/goods/list?categoryId=${id}`,
  method: "get"
})
// 商品
module.exports.categorys = (data) => Request({
  url: `/shop/goods/list`,data,
  method: "get",
  data
})
// 商品详情
module.exports.productdetails = (id) => Request({
  url: `/shop/goods/detail?id=${id}`,
  method: "get"
})
// 登录
module.exports.login = (code) => Request({
  url: `/user/wxapp/login?code=${code}`,
  method: "get",
  data:code
})
// 注册
module.exports.zhuce = (code) => Request({
  url: `/user/wxapp/register/simple?code=${code}`,
  method: "post",
})
//资产
module.exports.property = (token) => Request({
  url: `/user/amount?token=${token}`,
  method: "get"
})
//加入购物车
module.exports.addshop= (token,goodsId,number) => Request({
  url: `/shopping-cart/add?token=${token}&goodsId=${goodsId}&number=${number}`,
  method: "post"
})
//删除购物车某条数据
module.exports.delshop= (key,token) => Request({
  url: `/shopping-cart/remove?key=${key}&token=${token}`,
  method: "post"
})
//收藏
module.exports.shoucang= (id,token) => Request({
  url: `/shop/goods/fav/add?goodsId=${id}&token=${token}`,
  method: "post"
})
//读取购物车数据
module.exports.dqgoods= (token) => Request({
  url: `/shopping-cart/info?token=${token}`,
  method: "get"
})
//修改购买条数
module.exports.numbers= (key,token,number) => Request({
  url: `/shopping-cart/modifyNumber?key=${key}&token=${token}&number=${number}`,
  method: "post"
})
//收藏渲染
module.exports.collect= (token) => Request({
  url: `/shop/goods/fav/list?token=${token}`,
  method: "post"
})
//收藏删除
module.exports.delcollect= (id,token) => Request({
  url: `/shop/goods/fav/delete?goodsId=${id}&token=${token}`,
  method: "post"
})
//检测是否收藏
module.exports.collectcheck= (id,token) => Request({
  url: `/shop/goods/fav/check?goodsId=${id}&token=${token}`,
  method: "get"
})
//首页搜索
module.exports.search= (val,token) => Request({
  url: `/shop/goods/list?nameLike=${val}&token=${token}`,
  method: "post"
})
//添加地址
module.exports.dizhi= (obj) => Request({
  url: `/user/shipping-address/add`,
  method: "post",
  data:obj
})
//所有收获地址
module.exports.getdizhi= (token) => Request({
  url: `/user/shipping-address/list?token=${token}`,
  method: "get"
})
//修改收获地址
module.exports.editdizhi= (obj) => Request({
  url: `/user/shipping-address/update`,
  method: "post",
  data:obj
})
//删除收货地址
module.exports.deldizhi= (id,token) => Request({
  url: `/user/shipping-address/delete?id=${id}&token=${token}`,
  method: "post",
})
//退出登录
module.exports.logout= (token) => Request({
  url: `/user/loginout?token=${token}`,
  method: "get",
})